package org.example.controller;

import org.example.domain.vo.MenuVo;
import org.example.result.VividResult;
import org.example.service.ISysMenuService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("sys/menu")
public class SysMenuController {

    private final ISysMenuService sysMenuService;

    public SysMenuController(ISysMenuService sysMenuService) {
        this.sysMenuService = sysMenuService;
    }

    @GetMapping("/list")
    public VividResult getMenuList(){
        List<MenuVo> listMenuVos = sysMenuService.getListMenuVos();
        return VividResult.success(listMenuVos);
    }
}
